#include "head.h"

int init_status(status_t* status, int thread_num){

    status->thread_num = thread_num;

    status->thread_ids = (pthread_t*) malloc(thread_num * sizeof(pthread_t));
    
    if(!status->thread_ids){
        error(0, errno, "%s: %s : %d\n", __FILE__, __FUNCTION__, __LINE__);
        return -1;
    }


    memset(&status->q, 0, sizeof(queue_t));

    pthread_mutex_init(&status->lock, NULL);

    pthread_cond_init(&status->cond, NULL);

    return 0;
}
